TARGET=example

ifeq ($(ARCH), aarch64)
export GOOS=linux
export GOARCH=arm64
export GOARM=7
export CC=aarch64-linux-gnu-gcc
else ifeq ($(ARCH), arm)
export GOOS=linux
export GOARCH=arm
export CC=arm-xilinx-linux-gnueabi-gcc
endif

all: clean $(TARGET)

$(TARGET):
	CGO_ENABLED=1 go build -o $(TARGET) -ldflags="-s -w"

clean:
	rm -f $(TARGET)